<?php
 require_once('mod_config.php');
 //Auth_Mod('dbBackup');

if ($_REQUEST['action'] == 'restore')
{
    if (! eregi("\.sql$" , $_FILES['filename']['name']))
    {
       Alert("錯誤的SQL文件");
	   exit;
    }
    set_time_limit(0);
    $sql_file = $_FILES['filename']['tmp_name'];
    if (import($sql_file))
    {
        Alert('恢復數據成功');
		exit;
    }
    else
    {
       Alert('恢復數據失敗');
	   exit;
    }
}
?>